package com.demo.rabbitmq.config;

import java.util.HashMap;
import java.util.Map;

public enum PluginDirectExchangeEnum {
    PLUGIN_DIRECT_DELAY_EXCHANGE("plugin_direct_delay_exchange"),
    ;

    private final String exchangeName;

    PluginDirectExchangeEnum(String exchangeName) {
        this.exchangeName = exchangeName;
    }

    public String getExchangeName() {
        return exchangeName;
    }

    public Map<String, Object> getArgument() {
        Map<String, Object> map = new HashMap<>();
        if (this == PLUGIN_DIRECT_DELAY_EXCHANGE) {
            map.put("x-delayed-type", "direct");
        }
        return map;
    }
}
